package com.kantboot.user.account.domain.entity;

import com.kantboot.business.talent.domain.entity.*;
import jakarta.persistence.*;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 员工属性扩展
 */
@Getter
@Setter
@MappedSuperclass
public class UserAccountAttrExt implements Serializable {

    /* 以下是人才托举项目的参数 */

    /**
     * 当前技能等级ID
     */
    @Column(name = "current_skill_level_id")
    private Long currentSkillLevelId;

    /**
     * 当前技能等级获得时间
     */
    @Column(name = "gmt_current_skill_level_start")
    private Date gmtCurrentSkillLevelStart;

    /**
     * 当前职称等级ID
     */
    @Column(name = "current_title_level_id")
    private Long currentTitleLevelId;

    /**
     * 当前职称等级获得时间
     */
    @Column(name = "gmt_current_title_level_start")
    private Date gmtCurrentTitleLevelStart;

    /**
     * 当前专家人才等级ID
     */
    @Column(name = "current_expert_level_id")
    private Long currentExpertLevelId;

    /**
     * 当前专家人才等级获得时间
     */
    @Column(name = "gmt_current_expert_level_start")
    private Date gmtCurrentExpertLevelStart;

    /**
     * 当前专家人才等级结束时间
     */
    @Column(name = "gmt_current_expert_level_end")
    private Date gmtCurrentExpertLevelEnd;

    /**
     * 政府津贴等级数值
     * 10000 国务院政府特殊津贴
     * 9000  省部级政府特殊津贴
     */
    @Column(name = "government_allowance_level")
    private Integer governmentAllowanceLevel;

    /**
     * 当前工作系列编码
     */
    @Column(name = "current_work_series_id")
    private Long currentWorkSeriesId;

    /**
     * 当前工作系列开始时间
     */
    @Column(name = "gmt_current_work_series_start")
    private Date gmtCurrentWorkSeriesStart;

    /**
     * 院校
     */
    @Column(name = "schoolName")
    private String schoolName;

    /**
     * 是否国外院校
     */
    @Column(name = "is_foreign_school")
    private Boolean isForeignSchool;

    /**
     * 取得学历时间
     */
    @Column(name = "gmt_edu_start")
    private Date gmtEduStart;

    /**
     * 学历
     */
    @Column(name = "edu_level_number")
    private Integer eduLevelNumber;

    /**
     * 专业编码
     */
    @Column(name = "edu_major_code")
    private String eduMajorCode;


    /**
     * 学制不满两年制
     */
    @Column(name = "is_not_two_years_edu")
    private Boolean isNotTwoYearsEdu;

    /**
     * 教育经历
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id", insertable = false, updatable = false,foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentEduExperienceOfUserAccount> eduExperiencesOfUserAccount;


    /**
     * 学位编码
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id",
            insertable = false, updatable = false,
            foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    List<BusTalentEduMajorDegreeOfUserAccount> eduMajorDegrees;

    /**
     * 员工在所有系列的工作经历
     * 禁止外键
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id",
            insertable = false, updatable = false,
            foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentSeriesWorkExperienceOfUserAccount> seriesWorkExperiences;


    /**
     * 获得的奖项，会有多个奖项
     * 禁止外键
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id",
            insertable = false, updatable = false,
            foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentAwardOfUserAccount> talentAwardsOfUserAccount;

    /**
     * 人才计划
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id", insertable = false, updatable = false,foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentPlanOfUserAccount> talentPlansOfUserAccount;

    /**
     * 绩效
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id", insertable = false, updatable = false,foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentPerformanceOfUserAccount> talentPerformancesOfUserAccount;

    /**
     * 关联着所有技能等级经历
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id", insertable = false, updatable = false,foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentSkillLevelExperienceOfUserAccount> talentSkillLevelExperiencesOfUserAccount;

    /**
     * 关联着所有职称等级经历
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id", insertable = false, updatable = false, foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentTitleLevelExperienceOfUserAccount> talentTitleLevelExperiencesOfUserAccount;


    /**
     * 关联所有专家人才等级经历
     */
    @OneToMany
    @JoinColumn(name = "user_account_id", referencedColumnName = "id", insertable = false, updatable = false,foreignKey = @ForeignKey(ConstraintMode.NO_CONSTRAINT))
    private List<BusTalentExpertLevelExperienceOfUserAccount> talentExpertLevelExperiencesOfUserAccount;

    /**
     * 是否满足公司评选的专业委员会制定的业绩条件
     * 主要用于 首席专家 和 中国电科院院士 评选
     */
    @Column(name = "is_meet_performance_condition")
    private Boolean isMeetPerformanceCondition;

}
